<template>
  <!-- 新增上传画面对话框-->
  <el-dialog
    :title="title"
    center
    :visible.sync="openState"
    width="1024px"
    :close-on-click-modal="false"
    :before-close="handleClose"
    :append-to-body= "true"
  >
    <el-form ref="editForm" :model="form" :rules="rules" label-width="110px" disabled>
      <!--交易础信息-->
      <el-card class="form-card txnInfo-card">
        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="参与机构行号" prop="bankCode">
              <el-input v-model="form.bankCode" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="参与机构类别" prop="bankType">
              <el-select style="width: 100%;" v-model="form.bankType" placeholder="参与机构类别">
                <el-option
                  v-for="dict in dictMap.PT_TYPE"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="行别代码" prop="category">
              <el-input v-model="form.category" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="所属直参行号" prop="drctBankCode">
              <el-input v-model="form.drctBankCode" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="所属法人" prop="lglPrsn">
              <el-input v-model="form.lglPrsn" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="本行上级参与机构" prop="highOrg">
              <el-input v-model="form.highOrg" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="承接行行号" prop="bearBrno">
              <el-input v-model="form.bearBrno" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="管辖人行行号" prop="chargeBrno">
              <el-input v-model="form.chargeBrno" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="入账行行号信息" prop="acctBrno">
              <el-input v-model="form.acctBrno" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="所属CCPC" prop="lglCcpc">
              <el-input v-model="form.lglCcpc" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="所在城市代码" prop="lglCtcode">
              <el-input v-model="form.lglCtcode" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="参与机构全称" prop="orgFullname">
              <el-input v-model="form.orgFullname" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="加入业务系统标识" prop="joinBizFlag">
              <el-input v-model="form.joinBizFlag" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="电话/电挂" prop="tel">
              <el-input v-model="form.tel" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="使用次数" prop="useTimes">
              <el-date-picker style="width: 100%;" v-model="form.useTimes" value-format="yyyyMMddHHmmss"
                              type="datetime"
              />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="更新时间" prop="updTime">
              <el-date-picker style="width: 100%;" v-model="form.updTime" value-format="yyyyMMddHHmmss"
                              type="datetime"
              />
            </el-form-item>
          </el-col>

        </el-row>

        <el-row type="flex">
          <el-col :span="8">
            <el-form-item label="加入业务标识大额" prop="joinBizFlag1">
              <el-select style="width: 100%;" v-model="form.joinBizFlag1" placeholder="加入业务系统标识大额">
                <el-option
                  v-for="dict in dictMap.JOIN_BIZ_FLAG"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="8">
            <el-form-item label="加入业务标识小额" prop="joinBizFlag2">
              <el-select style="width: 100%;" v-model="form.joinBizFlag2" placeholder="加入业务系统标识小额">
                <el-option
                  v-for="dict in dictMap.JOIN_BIZ_FLAG"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="8">
            <el-form-item label="加入业务标识网银" prop="joinBizFlag3">
              <el-select style="width: 100%;" v-model="form.joinBizFlag3" placeholder="加入业务系统标识网银">
                <el-option
                  v-for="dict in dictMap.JOIN_BIZ_FLAG"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="8">
            <el-form-item label="HVPS系统状态" prop="status1">
              <el-select style="width: 100%;" v-model="form.status1" placeholder="HVPS系统状态">
                <el-option
                  v-for="dict in dictMap.CNAPSBANK_STATUS"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="8">
            <el-form-item label="BEPS系统状态" prop="status2">
              <el-select style="width: 100%;" v-model="form.status2" placeholder="BEPS系统状态">
                <el-option
                  v-for="dict in dictMap.CNAPSBANK_STATUS"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="8">
            <el-form-item label="IBPS系统状态" prop="status3">
              <el-select style="width: 100%;" v-model="form.status3" placeholder="IBPS系统状态">
                <el-option
                  v-for="dict in dictMap.CNAPSBANK_STATUS"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>


      </el-card>




    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button @click="cancel">关 闭</el-button>
    </div>
  </el-dialog>
</template>
<script>
import HtAmountInput from "@/views/components/HtAmountInput";
import HtAmountUpper from "@/views/components/HtAmountUpper";
import {  queryDetail } from "@/api/cnaps/bizMng/batchFileUpload";

export default {
  name: "bankBranchDetail",
  components: {
    HtAmountInput,
    HtAmountUpper,
  },
  props: {
    dictMap: {
      type: Object,
      default: () => {
        return {};
      },
    },
  },
  data() {
    return {
      busTypeList: [],
      id: "",
      title: "",
      pkgNo: "",
      // 是否显示弹出层
      openState: false,
      ifShowDelBtn: false,
      isEdit: false,

      // 字段可编辑控制

      // 表单参数
      form: {
        amount: 0.00,
        curcd: "CNY",
      },
      // 表单校验
      rules: {

      },
    };
  },
  mounted() {
  },
  computed: {
  },
  methods: {
    // 表单重置
    reset() {
      this.resetForm("editForm");
      this.$set(this, "form", {});
    },
    // 关闭回掉
    handleClose(done) {
      this.$confirm("确认关闭？")
        .then((_) => {
          this.reset();
          done();
        })
        .catch((_) => {
        });
    },

    show(row) {
      this.reset();
      this.title = "CNAPS行名行号查询明细";
      this.openState = true;
      this.ifShowDelBtn = false;
      this.$set(this, "form", row);
      let status = row.status;
      if(status.length>0){
        let statusArr = status.split("");
        if(status.length>0){
          this.$set(this.form,"status1",statusArr[0]);
        }
        if(status.length>1){
          this.$set(this.form,"status2",statusArr[1]);
        }
        if(status.length>2){
          this.$set(this.form,"status3",statusArr[2]);
        }
      }

      let joinBizFlag = row.joinBizFlag;
      if(joinBizFlag.length>0){
        let joinBizFlagArr = joinBizFlag.split("");
        if(joinBizFlag.length>0){
          this.$set(this.form,"joinBizFlag1",joinBizFlagArr[0]);
        }
        if(joinBizFlag.length>1){
          this.$set(this.form,"joinBizFlag2",joinBizFlagArr[1]);
        }
        if(joinBizFlag.length>2){
          this.$set(this.form,"joinBizFlag3",joinBizFlagArr[2]);
        }
      }
    },
    cancel() {
      this.openState = false;
    },



  },
};
</script>
<style>
.label-header-msg {
  font-weight: bold;
}

.form-card {
  margin-bottom: 10px;
}
</style>
